<template>
    <div>
        <div class="home1">
            <img class="home7" src="@/assets/1.png" />
            <img class="home7" src="@/assets/2.png" />
            <img class="home7" src="@/assets/3.png" />
            <img class="home7" src="@/assets/4.png" />
            <img class="home7" src="@/assets/5.png" />
            <img class="home7" src="@/assets/6.png" />
            <img class="home7" src="@/assets/7.png" />
            <img class="home7" src="@/assets/8.png" />
            <img class="home7" src="@/assets/9.png" />
            <img class="home7" src="@/assets/10.png" />
            <img class="home7" src="@/assets/12.png" />
        </div>

    </div>
</template>
  
<script>
// @ is an alias to /src

import i18n from '@/i18n';
import { Notify } from 'vant';
export default {
    name: 'Home1View',
    data() {
        return {
            isZh: true
        };
    },
    created() {

        if (i18n.locale == 'zh') {
            this.$store.state.isZh = true
        } else {
            this.$store.state.isZh = false
        }
    },
    methods: {
        goUrl(url) {
            window.open(url, '_blank')
        },
        goNav() {
            this.$router.push('/nav')
        },
        goWeb() {
            window.open("https://app.uniswap.org/", '_self')
        },
        goPrice() {
            window.open("https://m.ave.ai/token/0x787c17e7f05837e3ad85922a4343078079899a95-arbitrum", '_self')
        },
        clickPledge() {
            this.$router.push('/pledge/15')
        },
        share() {
            if (this.$store.state.address == '') {
                Notify(this.$t('m.no_connect'))
                return false
            }
            var element = this.createElement(this.$store.state.url + this.$store.state.address);
            element.select();
            element.setSelectionRange(0, element.value.length);
            document.execCommand('copy');
            element.remove();
            Notify({ type: 'success', message: this.$t("m.share_copy") });
        },
        //创建临时的输入框元素
        createElement(text) {
            var isRTL = document.documentElement.getAttribute('dir') === 'rtl';
            var element = document.createElement('textarea');
            // 防止在ios中产生缩放效果
            element.style.fontSize = '12pt';
            // 重置盒模型
            element.style.border = '0';
            element.style.padding = '0';
            element.style.margin = '0';
            // 将元素移到屏幕外
            element.style.position = 'absolute';
            element.style[isRTL ? 'right' : 'left'] = '-9999px';
            // 移动元素到页面底部
            let yPosition = window.pageYOffset || document.documentElement.scrollTop;
            element.style.top = `${yPosition}px`;
            //设置元素只读
            element.setAttribute('readonly', '');
            element.value = text;
            document.body.appendChild(element);
            return element;
        }
    }

}
</script>
<style scoped>
.home1 {
    display: flex;
    flex-direction: column;
    background-color: #000000;
    justify-content: center;
    align-items: center;
    max-width: 550px;
    margin: auto;
}
.home7{
    width: 360px;
    height: auto;
}
</style>
  
  